home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / CUGUK / PROG_TOO / C013.ZIP / GETS.C < prev    next >
Text File  |  1990-01-19  |  1KB  |  51 lines

  1. /********************************************************************
  2.  * C Users Group (U.K) C Source Code Library File CUGLIB.013        *
  3.  * Inquiries to: M. Houston, 36 Whetstone Clo. Farquhar Rd.         *
  4.  * Edgbaston, Birmingham B15 2QN ENGLAND                *
  5.  ********************************************************************
  6.  * File name: gets.c
  7.  * Program name:gets 
  8.  * Source of file: Ron Wellstead
  9.  * Purpose: An MS-DOS copy of the UNIX utility of the same name.
  10.  * Changes: <who what when & why major changes have been made>      
  11.  ********************************************************************/
  12.  
  13. /*
  14.  *
  15.  *    @(#) gets.c 1.2 87/07/27 
  16.  *
  17.  *    UNIX style gets utility for dos
  18.  *
  19.  *    copyright (c) 1987 Ron Wellsted.
  20.  *    This software is provided on the understanding that it is
  21.  *    NOT to be used for commercial gain. It may be freely distributed
  22.  *    in source or object form among amateur and hobby computer users ONLY!
  23.  *
  24.  *    copies a line of text from stdin (or command line) to stdout
  25.  *    usage:    gets [line....]
  26.  *    written for Microsoft C, link with setargv.obj to expand wildcards
  27.  */
  28. #include    <stdio.h>
  29.  
  30. char string[1024]="@(#) gets.c VR 1.0.0 15 Jul 1987";
  31.  
  32. main(argc,argv)
  33. int argc;
  34. char **argv;
  35. {
  36.     long start_time=0L,finish_time=0L;
  37.     char ch;
  38.  
  39.     if (argc<2)
  40.         gets(string);
  41.     else {
  42.         string[0]='\0';
  43.         while (--argc>0) {
  44.             strcat(string,*++argv);
  45.             strcat(string," ");
  46.         }
  47.     }
  48.     puts(string);
  49. }
  50.  
  51.